package com.itheima.d16_api_StringJoiner;

import java.util.StringJoiner;

public class Test {
    public static void main(String[] args) {
        System.out.println(getArrayData(new int[]{1,2,3}));

    }
    public static String getArrayData(int[] arr) {
        if (arr == null) {
            return null;
        }
        StringJoiner sj = new StringJoiner(",","[","]");
        for (int i = 0; i < arr.length; i++) {
            sj.add(arr[i] + "");
        }
        return sj.toString();
    }
}
